<template>
  <transition name="fade"
              @after-leave="handleAfterLeave">
    <div class="share-container"
         v-show="visible"
         @click="close()">
      <img src="../../assets/箭头152X146@2x.png"
           alt=""
           class="arrow">
      <img src="../../assets/文字~484X102@2x.png"
           alt=""
           class="text">
      <span class="btn">知道了</span>
    </div>
  </transition>
</template>

<script>
export default {
  name: 'ShareMask',
  data () {
    return {
      visible: false,
      successCb: undefined,
      title: '',
      loading: false,
    }
  },
  methods: {
    handleAfterLeave () {
      this.$destroy(true);
      this.$el.parentNode.removeChild(this.$el);
    },
    close () {
      this.visible = false;
      if (typeof this.cancelCb === 'function') {
        this.cancelCb();
      }
    },
    confirm () {
      this.visible = false;
      if (typeof this.confirmCb === 'function') {
        this.confirmCb(this);
      }
    },
    login () {
    }
  },
  mounted () {
  },
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
.share-container {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 100vw;
  background: rgba(0, 0, 0, 0.6);
  z-index: $maxIndex;
  .arrow {
    position: absolute;
    top: 0.16rem;
    right: 0.82rem;
    width: 1.35rem;
    height: 1.42rem;
  }
  .text {
    display: block;
    margin: 1.34rem auto 0;
    width: 4.83rem;
    height: 1.02rem;
  }
  .btn {
    display: block;
    margin: 0.4rem auto 0;
    width: 2rem;
    height: 0.64rem;
    border-radius: 0.32rem;
    border: 0.02rem dashed #ffffff;
    font-size: 0.36rem;
    color: #ffffff;
    text-align: center;
    line-height: 0.64rem;
  }
}

.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.5s;
}
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
  opacity: 0;
}
</style>
